const defaultRowHeight = 40;
function useGenStyle(width, rowsVisual, rowCount, align, tableState) {
    const { scrollToLeft, scrollToRight, scrollSize } = tableState;
    let tableHeight = rowsVisual.reduce((prev, crt) => {
        return prev + (crt.height || defaultRowHeight);
    }, 0)
    tableHeight += (rowCount - rowsVisual.length) * defaultRowHeight;
    let result = {
        tableStyle: { width: align === 'center' ? width + 1 : width },
        wrapperStyle: { height: tableHeight },
        midWrapperStyle: { height: tableHeight, paddingBottom: scrollSize },
        defaultRowHeight
    }
    if (align === 'center') {
        result.wrapperStyle = { ...result.wrapperStyle, flex: 1 }
    } else {
        if (align === 'left' && !scrollToLeft) {
            result.wrapperStyle = { ...result.wrapperStyle, boxShadow: '0px 6px 8px 0px rgba(0,0,0,0.1500)' };
        } else if (align === 'right' && !scrollToRight) {
            result.wrapperStyle = { ...result.wrapperStyle, boxShadow: '0px 6px 8px 0px rgba(0,0,0,0.1500)' };
        }
        result.wrapperStyle = { ...result.wrapperStyle, width, zIndex: 2 }
    }
    return result;
}
export default useGenStyle;